package com.rongshu.sendmessage.util.httpUtil;


import com.rongshu.sendmessage.base.MyApplication;
import com.rongshu.sendmessage.util.StringUtils;

public class Common {

    //    "http://39.105.171.217:9519/jkws";
//    "https://www.rongskj.com/ryb";//线上服务器地址，上线地址
//    "https://rongskj.cn1.utools.club";//本地服务，调试bug方便，工作时间
//    public static String BASE_URL1="http://39.105.171.217:8600";
    private String REQUST_URL="";
    //http://www.kyxxylzx.com/tckx
    private final String Base="http://www.kyxxylzx.com";//http://39.103.223.73:80";
//    http://39.103.223.73/tckx
    public String REQUST_URL1=Base+"/tckx";//https://www.rongskj.com/ryb
    public String REQUST_URL2=Base+"/tckx";
    public String REQUST_URL3=Base+"/tckx";
    //默认地址在这里设置，01默认是正式地址，1是测试地址，2是本地地址
    public int getType() {
        return MyApplication.mSettings.getInt(HYContent.REQUST_TYPE,0);
    }
    public Common() {
        String url= MyApplication.mSettings.getString(HYContent.REQUST_URL,"空");
        int type= getType();
        if (!url.equals("空")&&!StringUtils.isEmpty(url)){
            setRequstUrl(url);//有url
        }else{
            if (type==1){
                setRequstUrl(REQUST_URL2);
            }else if (type==2){
                setRequstUrl(REQUST_URL3);
            }else{
                setRequstUrl(REQUST_URL1);
            }

        }
    }
    public String getRequstUrl() {
         return REQUST_URL;
    }
    private void setRequstUrl(String requstUrl) {
        REQUST_URL = requstUrl;
    }
}
